﻿<internal:BaseControlPartView x:Class="UColor.WPF.Internal.BaseControlModuleWrapperView"
    xmlns:dxdb="clr-namespace:UColor.WPF"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:helpers="clr-namespace:UColor.WPF.Helpers"
    xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:ddhelpers="clr-namespace:UColor.Core.Helpers;assembly=UColor.Core"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:dxl="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
    xmlns:internal="clr-namespace:UColor.WPF.Internal"
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="300">

    <internal:BaseControlPartView.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/UColor.APP;component/Helpers/Themes/InvisibleBorder.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <helpers:ThemeSelectorHelper x:Key="ThemeSelectorHelper" />
            <ddhelpers:BoolInverter x:Key="BoolInverter" />
            <dx:VisibilityInverseConverter x:Key="VisibilityInverseConverter" />
            <ddhelpers:EmptyConverter x:Key="EmptyConverter" />
            <dx:NullableToVisibilityConverter x:Key="NullableToVisibilityConverter" />
            <dx:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
            <ddhelpers:SelectConverter x:Key="ModuleBorderBrushConverter" DefaultValue="{ddhelpers:BrushValue S=#FF484848}">
                <ddhelpers:SelectState Key="Office2007Silver" Value="{ddhelpers:BrushValue S=#FF6F7074}" />
                <ddhelpers:SelectState Key="Office2007Black" Value="{ddhelpers:BrushValue S=#FF4C535C}" />
                <ddhelpers:SelectState Key="Office2007Blue" Value="{ddhelpers:BrushValue S=#FF6593CF}" />
                <ddhelpers:SelectState Key="Office2010Black" Value="{ddhelpers:BrushValue S=#FF484848}" />
                <ddhelpers:SelectState Key="Office2010Blue" Value="{ddhelpers:BrushValue S=#FF9EB1C6}" />
                <ddhelpers:SelectState Key="Office2010Silver" Value="{ddhelpers:BrushValue S=#FFB5B9BE}" />
                <ddhelpers:SelectState Key="Office2013" Value="{ddhelpers:BrushValue S=#FFACACAC}" />
                <ddhelpers:SelectState Key="DeepBlue" Value="{ddhelpers:BrushValue S=#FF062B63}" />
                <ddhelpers:SelectState Key="LightGray" Value="{ddhelpers:BrushValue S=#FF6E6E6E}" />
                <ddhelpers:SelectState Key="Seven" Value="{ddhelpers:BrushValue S=#FF979797}" />
                <ddhelpers:SelectState Key="MetropolisDark" Value="{ddhelpers:BrushValue S=#FF333333}" />
                <ddhelpers:SelectState Key="VS2010" Value="{ddhelpers:BrushValue S=#FF8591A2}" />
                <ddhelpers:SelectState Key="DXStyle" Value="{ddhelpers:BrushValue S=#FF9DA0AA}" />
                <ddhelpers:SelectState Key="MetropolisLight" Value="{ddhelpers:BrushValue S=#FFB9B9B9}" />
            </ddhelpers:SelectConverter>
            <ddhelpers:SelectConverter x:Key="XamlTextViewerVisiblityConverter">
                <ddhelpers:SelectState Key="Demo" Value="{ddhelpers:VisibilityValue S=Collapsed}" />
                <ddhelpers:SelectState Key="CSCode" Value="{ddhelpers:VisibilityValue S=Collapsed}" />
                <ddhelpers:SelectState Key="VBCode" Value="{ddhelpers:VisibilityValue S=Collapsed}" />
                <ddhelpers:SelectState Key="Xaml" Value="{ddhelpers:VisibilityValue S=Visible}" />
            </ddhelpers:SelectConverter>
            <ddhelpers:SelectConverter x:Key="CSCodeTextViewerVisiblityConverter">
                <ddhelpers:SelectState Key="Demo" Value="{ddhelpers:VisibilityValue S=Collapsed}" />
                <ddhelpers:SelectState Key="CSCode" Value="{ddhelpers:VisibilityValue S=Visible}" />
                <ddhelpers:SelectState Key="VBCode" Value="{ddhelpers:VisibilityValue S=Collapsed}" />
                <ddhelpers:SelectState Key="Xaml" Value="{ddhelpers:VisibilityValue S=Collapsed}" />
            </ddhelpers:SelectConverter>
            <ddhelpers:SelectConverter x:Key="VBCodeTextViewerVisiblityConverter">
                <ddhelpers:SelectState Key="Demo" Value="{ddhelpers:VisibilityValue S=Collapsed}" />
                <ddhelpers:SelectState Key="CSCode" Value="{ddhelpers:VisibilityValue S=Collapsed}" />
                <ddhelpers:SelectState Key="VBCode" Value="{ddhelpers:VisibilityValue S=Visible}" />
                <ddhelpers:SelectState Key="Xaml" Value="{ddhelpers:VisibilityValue S=Collapsed}" />
            </ddhelpers:SelectConverter>
            <ddhelpers:SelectConverter x:Key="DemoIsHitTestVisibleConverter">
                <ddhelpers:SelectState Key="Demo" Value="{ddhelpers:BoolValue S=True}" />
                <ddhelpers:SelectState Key="CSCode" Value="{ddhelpers:BoolValue S=False}" />
                <ddhelpers:SelectState Key="VBCode" Value="{ddhelpers:BoolValue S=False}" />
                <ddhelpers:SelectState Key="Xaml" Value="{ddhelpers:BoolValue S=False}" />
            </ddhelpers:SelectConverter>
            <ddhelpers:SelectConverter x:Key="DemoVisibilityConverter">
                <ddhelpers:SelectState Key="Demo" Value="{ddhelpers:VisibilityValue S=Visible}" />
                <ddhelpers:SelectState Key="CSCode" Value="{ddhelpers:VisibilityValue S=Collapsed}" />
                <ddhelpers:SelectState Key="VBCode" Value="{ddhelpers:VisibilityValue S=Collapsed}" />
                <ddhelpers:SelectState Key="Xaml" Value="{ddhelpers:VisibilityValue S=Collapsed}" />
            </ddhelpers:SelectConverter>
            <ddhelpers:SelectConverter x:Key="OptionsExpandFactorConverter">
                <ddhelpers:SelectConverter.Transitions>
                    <ddhelpers:SelectTransition To="Options">
                        <Storyboard>
                            <DoubleAnimation From="0" To="1" BeginTime="00:00:00.25" Duration="00:00:00.25" Storyboard.TargetProperty="(helpers:RenderExpander.ExpandFactor)" />
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.ZIndex)">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{ddhelpers:IntValue S=10}" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </ddhelpers:SelectTransition>
                    <ddhelpers:SelectTransition From="Options">
                        <Storyboard>
                            <DoubleAnimation From="1" To="0" Duration="00:00:00.25" Storyboard.TargetProperty="(helpers:RenderExpander.ExpandFactor)" />
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.ZIndex)">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{ddhelpers:IntValue S=1}" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </ddhelpers:SelectTransition>
                </ddhelpers:SelectConverter.Transitions>
                <ddhelpers:SelectState Key="Options" Value="{ddhelpers:DoubleValue S=1}" />
                <ddhelpers:SelectState Key="Themes" Value="{ddhelpers:DoubleValue S=0}" />
                <ddhelpers:SelectState Key="Description" Value="{ddhelpers:DoubleValue S=0}" />
                <ddhelpers:SelectState Key="Sidebar" Value="{ddhelpers:DoubleValue S=0}" />
            </ddhelpers:SelectConverter>
            <ddhelpers:SelectConverter x:Key="DescriptionExpandFactorConverter">
                <ddhelpers:SelectConverter.Transitions>
                    <ddhelpers:SelectTransition To="Description">
                        <Storyboard>
                            <DoubleAnimation From="0" To="1" BeginTime="00:00:00.25" Duration="00:00:00.25" Storyboard.TargetProperty="(helpers:RenderExpander.ExpandFactor)" />
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.ZIndex)">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{ddhelpers:IntValue S=10}" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </ddhelpers:SelectTransition>
                    <ddhelpers:SelectTransition From="Description">
                        <Storyboard>
                            <DoubleAnimation From="1" To="0" Duration="00:00:00.25" Storyboard.TargetProperty="(helpers:RenderExpander.ExpandFactor)" />
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.ZIndex)">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{ddhelpers:IntValue S=1}" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </ddhelpers:SelectTransition>
                </ddhelpers:SelectConverter.Transitions>
                <ddhelpers:SelectState Key="Options" Value="{ddhelpers:DoubleValue S=0}" />
                <ddhelpers:SelectState Key="Themes" Value="{ddhelpers:DoubleValue S=0}" />
                <ddhelpers:SelectState Key="Description" Value="{ddhelpers:DoubleValue S=1}" />
                <ddhelpers:SelectState Key="Sidebar" Value="{ddhelpers:DoubleValue S=0}" />
            </ddhelpers:SelectConverter>

            <ddhelpers:SelectConverter x:Key="SidebarExpandFactorConverter">
                <ddhelpers:SelectConverter.Transitions>
                    <ddhelpers:SelectTransition To="Sidebar">
                        <Storyboard>
                            <DoubleAnimation From="0" To="1" BeginTime="00:00:00.25" Duration="00:00:00.25" Storyboard.TargetProperty="(helpers:RenderExpander.ExpandFactor)" />
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.ZIndex)">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{ddhelpers:IntValue S=10}" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </ddhelpers:SelectTransition>
                    <ddhelpers:SelectTransition From="Sidebar">
                        <Storyboard>
                            <DoubleAnimation From="1" To="0" Duration="00:00:00.25" Storyboard.TargetProperty="(helpers:RenderExpander.ExpandFactor)" />
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.ZIndex)">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{ddhelpers:IntValue S=1}" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </ddhelpers:SelectTransition>
                </ddhelpers:SelectConverter.Transitions>
                <ddhelpers:SelectState Key="Options" Value="{ddhelpers:DoubleValue S=0}" />
                <ddhelpers:SelectState Key="Themes" Value="{ddhelpers:DoubleValue S=0}" />
                <ddhelpers:SelectState Key="Description" Value="{ddhelpers:DoubleValue S=0}" />
                <ddhelpers:SelectState Key="Sidebar" Value="{ddhelpers:DoubleValue S=1}" />
            </ddhelpers:SelectConverter>

            <ddhelpers:SelectConverter x:Key="ThemesExpandFactorConverter">
                <ddhelpers:SelectConverter.Transitions>
                    <ddhelpers:SelectTransition To="Themes">
                        <Storyboard>
                            <DoubleAnimation From="0" To="1" BeginTime="00:00:00.25" Duration="00:00:00.25" Storyboard.TargetProperty="(helpers:RenderExpander.ExpandFactor)" />
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.ZIndex)">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{ddhelpers:IntValue S=10}" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </ddhelpers:SelectTransition>
                    <ddhelpers:SelectTransition From="Themes">
                        <Storyboard>
                            <DoubleAnimation From="1" To="0" Duration="00:00:00.25" Storyboard.TargetProperty="(helpers:RenderExpander.ExpandFactor)" />
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.ZIndex)">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{ddhelpers:IntValue S=1}" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </ddhelpers:SelectTransition>
                </ddhelpers:SelectConverter.Transitions>
                <ddhelpers:SelectState Key="Options" Value="{ddhelpers:DoubleValue S=0}" />
                <ddhelpers:SelectState Key="Themes" Value="{ddhelpers:DoubleValue S=1}" />
                <ddhelpers:SelectState Key="Description" Value="{ddhelpers:DoubleValue S=0}" />
                <ddhelpers:SelectState Key="Sidebar" Value="{ddhelpers:DoubleValue S=0}" />
            </ddhelpers:SelectConverter>
            <ddhelpers:SelectConverter x:Key="GroupFramePaddingInOptionsConverter">
                <ddhelpers:SelectState Key="True" Value="{ddhelpers:DoubleValue S=0}" />
                <ddhelpers:SelectState Key="False" Value="{ddhelpers:DoubleValue S=6}" />
            </ddhelpers:SelectConverter>
            <Style x:Key="DemoModuleControl" TargetType="dxdb:DemoModuleControl">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="dxdb:DemoModuleControl">
                            <Grid FlowDirection="LeftToRight">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <TextBlock Foreground="#FF505050" Opacity="1" FontSize="16" TextWrapping="Wrap" helpers:TextTrimmingHelper.TextTrimming="CharacterEllipsis" Text="{Binding Parent.Owner.ShortDescription.TextAsync, RelativeSource={RelativeSource TemplatedParent}}" Margin="0,0,0,6" />
                                <Grid Grid.Row="1">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Border BorderThickness="1"
                                        BorderBrush="{ddhelpers:SelectBinding Binding={Binding ApplicationTheme.Name, Source={StaticResource ThemeSelectorHelper}}, Converter={StaticResource ModuleBorderBrushConverter}}" />
                                    <Grid x:Name="ContentContainer">
                                        <dx:BackgroundPanel Margin="1" FlowDirection="{TemplateBinding FlowDirection}" x:Name="DemoContentElement" Content="{TemplateBinding Content}" DataContext="{Binding RelativeSource={RelativeSource AncestorType=dxdb:DemoModuleControl}, Path=DataContext}"
                                            IsHitTestVisible="{ddhelpers:SelectBinding Binding={Binding View, RelativeSource={RelativeSource TemplatedParent}}, Converter={StaticResource DemoIsHitTestVisibleConverter}}" />
                                        <helpers:CornerPopup x:Name="CornerPopup" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" dx:FocusHelper2.Focusable="False" IsTabStop="False"
                                            Visibility="{ddhelpers:SelectBinding Binding={Binding View, RelativeSource={RelativeSource TemplatedParent}}, Converter={StaticResource DemoVisibilityConverter}}" />
                                        <Grid x:Name="CodeOwner" helpers:ThemeHelper.ThemeName="Demo,Code:DemoModule">
                                            <helpers:CodeViewControl IsSearchExpanded="True" x:Name="XamlTextViewer" CodeLanguage="XAML" helpers:KeyboardFocusHelper.Focusable="True" HorizontalAlignment="Stretch"
                                                    Visibility="{ddhelpers:SelectBinding Binding={Binding View, RelativeSource={RelativeSource TemplatedParent}}, Converter={StaticResource XamlTextViewerVisiblityConverter}}"
                                                    CodeText="{Binding Path=Parent.Owner.XamlText.Value, RelativeSource={RelativeSource TemplatedParent}}" />
                                            <helpers:CodeViewControl IsSearchExpanded="True" x:Name="VBCodeTextViewer" CodeLanguage="VB" helpers:KeyboardFocusHelper.Focusable="True" HorizontalAlignment="Stretch"
                                                    Visibility="{ddhelpers:SelectBinding Binding={Binding View, RelativeSource={RelativeSource TemplatedParent}}, Converter={StaticResource VBCodeTextViewerVisiblityConverter}}"
                                                    CodeText="{Binding Path=Parent.Owner.VBCodeText.Value, RelativeSource={RelativeSource TemplatedParent}}" />
                                            <helpers:CodeViewControl IsSearchExpanded="True" x:Name="CSCodeTextViewer" CodeLanguage="CS" helpers:KeyboardFocusHelper.Focusable="True" HorizontalAlignment="Stretch"
                                                    Visibility="{ddhelpers:SelectBinding Binding={Binding View, RelativeSource={RelativeSource TemplatedParent}}, Converter={StaticResource CSCodeTextViewerVisiblityConverter}}"
                                                    CodeText="{Binding Path=Parent.Owner.CSCodeText.Value, RelativeSource={RelativeSource TemplatedParent}}" />
                                            <dxdb:BaseLoadingControl LoadingInProgress="{Binding Parent.Owner.LoadingInProgress, RelativeSource={RelativeSource TemplatedParent}}" LoadingBackground="{Binding Parent.Owner.LoadingBackground, RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                            <dxdb:ThemeSelectingLoadingControl LoadingInProgress="{Binding LoadingInProgress, Source={StaticResource ThemeSelectorHelper}}" LoadingBackground="{Binding Parent.Owner.LoadingBackground, RelativeSource={RelativeSource TemplatedParent}}"  HorizontalAlignment="Center" VerticalAlignment="Center" />
                                        </Grid>
                                    </Grid>
                                    <dx:DXExpander Grid.Column="1" x:Name="OptionsContentContainer" helpers:ThemeHelper.ThemeName="Demo,Options1:DemoModule" HorizontalExpand="FromRightToLeft" VerticalExpand="None"
                                            IsExpanded="{Binding OptionsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Margin="0,-6,0,0">
                                        <helpers:WidthPanel Margin="20,0,0,0">
                                            <helpers:RenderExpander VerticalAlignment="Top" HorizontalAlignment="Stretch"
                                                    ExpandFactor="{ddhelpers:SelectBinding UseTransitionBinding={Binding OptionsExpanded, RelativeSource={RelativeSource TemplatedParent}}, Binding={Binding OptionsView, RelativeSource={RelativeSource TemplatedParent}}, Converter={StaticResource DescriptionExpandFactorConverter}}">
                                                <dx:GroupFrame x:Name="DescriptionContentContainer" MinWidth="230" Header="About">
                                                    <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalAlignment="Stretch" BorderThickness="0" UseLayoutRounding="True" Foreground="#FF3C3C3C" >
                                                        <Grid Margin="1">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="Auto" />
                                                                <RowDefinition Height="Auto" />
                                                            </Grid.RowDefinitions>
                                                            <dx:DocumentPresenter IsTabStop="False" Background="Transparent" dx:FocusHelper2.Focusable="False" Document="{Binding Parent.Owner.Description.TextAsync, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Top" />
                                                            <Grid Grid.Row="1" Visibility="{Binding Parent.Owner.ShowLinks, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}" VerticalAlignment="Top">
                                                                <Grid.RowDefinitions>
                                                                    <RowDefinition Height="Auto" />
                                                                    <RowDefinition Height="Auto" />
                                                                </Grid.RowDefinitions>
                                                                <TextBlock Text="Related Links:" FontWeight="Bold" Margin="0,12,0,0" />
                                                               
                                                            </Grid>
                                                        </Grid>
                                                    </ScrollViewer>
                                                </dx:GroupFrame>
                                            </helpers:RenderExpander>
                                            <helpers:RenderExpander VerticalAlignment="Top" HorizontalAlignment="Stretch"
                                                    ExpandFactor="{ddhelpers:SelectBinding UseTransitionBinding={Binding OptionsExpanded, RelativeSource={RelativeSource TemplatedParent}},  Binding={Binding OptionsView, RelativeSource={RelativeSource TemplatedParent}}, Converter={StaticResource SidebarExpandFactorConverter}}">
                                                <ContentControl Margin="0,6,0,0" x:Name="SidebarContentContainer" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" MinWidth="230" />
                                            </helpers:RenderExpander>
                                            <helpers:RenderExpander VerticalAlignment="Top" HorizontalAlignment="Stretch" helpers:WidthPanel.MeasureTypeAuto="True"
                                                    ExpandFactor="{ddhelpers:SelectBinding UseTransitionBinding={Binding OptionsExpanded, RelativeSource={RelativeSource TemplatedParent}},  Binding={Binding OptionsView, RelativeSource={RelativeSource TemplatedParent}}, Converter={StaticResource OptionsExpandFactorConverter}}">
                                                <helpers:TopTextPanel>
                                                    <helpers:TopTextPanel.TopChild>
                                                        <Grid x:Name="OptionsTopTextContainer"
                                                                Visibility="{Binding OptionsTopText, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource NullableToVisibilityConverter}}">
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="Auto"/>
                                                                <RowDefinition Height="Auto"/>
                                                            </Grid.RowDefinitions>
                                                            <TextBlock x:Name="OptionsTopText" VerticalAlignment="Top" HorizontalAlignment="Stretch" TextWrapping="Wrap" Foreground="Black" Text="{TemplateBinding OptionsTopText}"/>
                                                            <Grid x:Name="PanelHeaderSeparator" Height="2" Margin="-12,5" Grid.Row="1">
                                                                <Rectangle Height="1" VerticalAlignment="Top" Opacity="0.3">
                                                                    <Rectangle.Fill>
                                                                        <LinearGradientBrush EndPoint="0,0.5" StartPoint="1,0.5">
                                                                            <GradientStop Color="#00221B4A" Offset="0" />
                                                                            <GradientStop Color="#00221B4A" Offset="1" />
                                                                            <GradientStop Color="#FF221B4A" Offset="0.5" />
                                                                        </LinearGradientBrush>
                                                                    </Rectangle.Fill>
                                                                </Rectangle>
                                                                <Rectangle Height="1" VerticalAlignment="Bottom" Opacity="0.1">
                                                                    <Rectangle.Fill>
                                                                        <LinearGradientBrush EndPoint="0,0.5" StartPoint="1,0.5">
                                                                            <GradientStop Color="#00FFFFFF" />
                                                                            <GradientStop Color="#00FFFFFF" Offset="1" />
                                                                            <GradientStop Color="White" Offset="0.5" />
                                                                        </LinearGradientBrush>
                                                                    </Rectangle.Fill>
                                                                </Rectangle>
                                                            </Grid>
                                                        </Grid>
                                                    </helpers:TopTextPanel.TopChild>
                                                    <helpers:TopTextPanel.MainChild>
                                                        <Grid>
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="Auto" />
                                                                <RowDefinition Height="*" />
                                                            </Grid.RowDefinitions>
                                                            <Border Style="{StaticResource InvisibleBorder}"
                                                                Height="{ddhelpers:SelectBinding Binding={Binding SupressGroupFramePaddingInOptions, RelativeSource={RelativeSource TemplatedParent}}, Converter={StaticResource GroupFramePaddingInOptionsConverter}}"
                                                                Visibility="{Binding Visibility, ElementName=OptionsTopTextContainer, Converter={StaticResource VisibilityInverseConverter}}" />
                                                            <ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="{TemplateBinding OptionsContentVerticalScrollVisibility}" Foreground="Black"
                                                                MinWidth="230">
                                                                <ContentPresenter Content="{TemplateBinding OptionsContent}" UseLayoutRounding="True" helpers:ThemeHelper.ApplyTextForegroundToContent="True" helpers:ThemeHelper.ContentThemeName="Demo,Options:DemoModule">
                                                                    <!--BEGIN WPF-->
                                                                    <TextElement.Foreground>
                                                                        <SolidColorBrush Color="Black"/>
                                                                    </TextElement.Foreground>
                                                                    <!--END WPF-->
                                                                </ContentPresenter>
                                                            </ScrollViewer>
                                                        </Grid>
                                                    </helpers:TopTextPanel.MainChild>
                                                </helpers:TopTextPanel>
                                            </helpers:RenderExpander>
                                            <helpers:RenderExpander HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                                    ExpandFactor="{ddhelpers:SelectBinding UseTransitionBinding={Binding OptionsExpanded, RelativeSource={RelativeSource TemplatedParent}},  Binding={Binding OptionsView, RelativeSource={RelativeSource TemplatedParent}}, Converter={StaticResource ThemesExpandFactorConverter}}">
                                                <dx:GroupFrame MinWidth="230" Header="Theming" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                                                    <dx:GroupFrame.Resources>
                                                        <ResourceDictionary>
                                                            <ResourceDictionary.MergedDictionaries>
                                                                <ResourceDictionary Source="/UColor.APP;component/Helpers/Themes/ThemesListboxEditResources.xaml" />
                                                            </ResourceDictionary.MergedDictionaries>
                                                        </ResourceDictionary>
                                                    </dx:GroupFrame.Resources>
                                                    <dxe:ListBoxEdit dx:FocusHelper2.Focusable="False" x:Name="ThemeSelector" ShowBorder="False" ItemContainerStyle="{StaticResource ThemesListboEditItemStyle}" 
                                                        SelectedItem="{Binding Path=ApplicationTheme, Source={StaticResource ThemeSelectorHelper}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                                                        ItemsSource="{Binding Path=Themes, Source={StaticResource ThemeSelectorHelper}}"
                                                        HorizontalContentAlignment="Stretch"
                                                        ItemTemplate="{StaticResource ThemeTemplate}"
                                                        HorizontalAlignment="Stretch" />
                                                </dx:GroupFrame>
                                            </helpers:RenderExpander>
                                        </helpers:WidthPanel>
                                    </dx:DXExpander>
                                </Grid>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </internal:BaseControlPartView.Resources>
    <helpers:DemoTransferControl IsDemoGone="{Binding IsDemoGone}" IsNextDemoRequested="{Binding CurrentIsNextDemoRequested}">
        <interactivity:Interaction.Triggers>
            <interactivity:EventTrigger EventName="DemoGone">
                <interactivity:InvokeCommandAction Command="{Binding OnDemoGoneCommand}" />
            </interactivity:EventTrigger>
            <interactivity:EventTrigger EventName="DemoCame">
                <interactivity:InvokeCommandAction Command="{Binding OnDemoCameCommand}" />
            </interactivity:EventTrigger>
        </interactivity:Interaction.Triggers>
        <helpers:DemoTransferControl.Content>
            <Grid>
                <ContentPresenter x:Name="DemoModule1Presenter" />
                <ContentPresenter x:Name="DemoModule2Presenter" />
            </Grid>
        </helpers:DemoTransferControl.Content>
    </helpers:DemoTransferControl>
</internal:BaseControlPartView>